package week9;


import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main2 {

	public static void main(String[] args) {
		Set<String> words=new TreeSet<String>();
		Scanner sc = new Scanner(System.in);
		int n=0;
		while(true){
			String word = sc.next();
			if(word.equals("!!!!!"))
				break;
			words.add(word);
			
		}
		System.out.println(words.size());
		for(String e : words){
			if(n++>=10)
				break;
			System.out.println(e);
		}
			
		sc.close();
	}

	
}
